Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deps): bump mongosh, driver to latest COMPASS-9056 #6774

Merged
merged 5 commits into from
Mar 6, 2025
Merged

Conversation

addaleax
Copy link
Collaborator

@addaleax addaleax commented Mar 5, 2025

This includes adjusting the CSFLE/QE collection tracker for the Node.js driver changes related to $lookup support, where filters for listCollections can now list multiple collections in an $in clause.

Description

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

This includes adjusting the CSFLE/QE collection tracker for the Node.js
driver changes related to `$lookup` support, where filters for listCollections
can now list multiple collections in an `$in` clause.
Copy link
Collaborator

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, but obviously would be a good idea to get a review from someone more knowledgeable.

`[Compass] Unexpected listCollections request on '${dbName}' with name: '${
filter?.name as string
}'`
`[Compass] Unexpected listCollections request on '${dbName}' with filter: ${EJSON.stringify(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Should we include the shape of the filter that we expect? I find it a much nicer DX when I get an error that not only tells me that I did something wrong, but also helps me do the right thing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but honestly I don't think that would be worth it, if this actually gets thrown at some point, that means we're going to have to do some digging into the root cause anyway

@@ -437,53 +446,70 @@ export class CSFLECollectionTrackerImpl implements CSFLECollectionTracker {
filter: Document,
collectionInfos: CollectionInfo[]
): Error | undefined {
if (typeof filter?.name !== 'string' || collectionInfos.length > 1) {
// filter is either { name: string } or { name: { $in: string[] } }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be documented as a type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but the point here is that the input isn't of a known type ... we could split this out into a separate validation function if you prefer, that takes a generic unknown or Document input and returns this type

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I don't have strong feelings about it; leaving it as is is fine also 👍

@addaleax addaleax merged commit 64a2126 into main Mar 6, 2025
52 of 54 checks passed
@addaleax addaleax deleted the 9056-dev branch March 6, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants